import 'package:tender_flutter/page/subscription/model/subscript_category_entity.dart';
import 'package:tender_flutter/page/home/model/common_tag_model.dart';

subscriptCategoryEntityFromJson(SubscriptCategoryEntity data, Map<String, dynamic> json) {
	if (json['types'] != null) {
		data.types = new List<CommonTagModel>();
		(json['types'] as List).forEach((v) {
			data.types.add(new CommonTagModel().fromJson(v));
		});
	}
	if (json['biddingClass'] != null) {
		data.biddingClass = new List<CommonTagModel>();
		(json['biddingClass'] as List).forEach((v) {
			data.biddingClass.add(new CommonTagModel().fromJson(v));
		});
	}
	if (json['industries'] != null) {
		data.industries = new List<CommonTagModel>();
		(json['industries'] as List).forEach((v) {
			data.industries.add(new CommonTagModel().fromJson(v));
		});
	}
	return data;
}

Map<String, dynamic> subscriptCategoryEntityToJson(SubscriptCategoryEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	if (entity.types != null) {
		data['types'] =  entity.types.map((v) => v.toJson()).toList();
	}
	if (entity.biddingClass != null) {
		data['biddingClass'] =  entity.biddingClass.map((v) => v.toJson()).toList();
	}
	if (entity.industries != null) {
		data['industries'] =  entity.industries.map((v) => v.toJson()).toList();
	}
	return data;
}